<template>
  <div class="rights">
    <breadcrumb :first="'权限管理'"></breadcrumb>
    <el-card>
      <el-table
        :data="rightsDataList"
        height="450"
        border
        style="width: 100%"
        stripe
      >
        <el-table-column prop="id" label="#" width="50"> </el-table-column>
        <el-table-column prop="authName" label="权限名称"> </el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column prop="level" label="权限等级">
          <template slot-scope="scope">
            <el-tag v-if="scope.row.level === '0'">一级</el-tag>
            <el-tag type="success" v-else-if="scope.row.level === '1'"
              >二级</el-tag
            >
            <el-tag type="warning" v-else>三级</el-tag>
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>

<script>
import { rightsList } from "@/api/index";
import breadcrumb from "@/components/breadcrumb.vue";
export default {
  data() {
    return {
      rightsDataList: [],
    };
  },
  components: {
    breadcrumb,
  },
  created() {
    this.getrightsList()
  },
  methods: {
    getrightsList() {
      rightsList("list").then((res) => {
        this.rightsDataList = res.data.data;
      });
    },
  },
};
</script>

<style lang="less" scoped>
.rights {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  padding: 10px;
  background-color: #fafafa;
  padding: 10px;
  /deed/.el-table {
    text-align: center;
  }
}
</style>
